﻿using AppSocketModel;
using AppSocketModel.Alarm;
using System.Collections.Generic;

namespace AppSocketService.Alarm
{
    public interface IAlarmService
    {

        /// <summary>
        /// 初始化REDIS用,获取全部报警配置
        /// </summary>
        /// <returns></returns>
        List<AlarmDto> InitRedisGetAll();


        /// <summary>
        /// 获取报警配置
        /// </summary>
        /// <param name="IMEI"></param>
        /// <returns></returns>
        AlarmDto GetAlarmConfig(string IMEI);

        /// <summary>
        /// 设备报警配置 (根据IMEI)
        /// </summary>
        /// <param name="dto"></param>
        bool SetAlarmConfig(AlarmDto dto);

        /// <summary>
        /// 获取已经配置的报警类型
        /// </summary>
        /// <param name="imei"></param>
        /// <returns></returns>
        List<AlarmType> GetAlarmTypes(string imei);

        /// <summary>
        /// 获取指定类型的报警配置
        /// </summary>
        /// <param name="imei"></param>
        /// <param name="alarmType">报警类型</param>
        /// <returns></returns>
        AlarmTypeBase GetAlarmConfigByType(string imei, AlarmType alarmType);

        /// <summary>
        /// 设置指定类型的报警配置
        /// </summary>
        /// <param name="imei"></param>
        /// <param name="alarmSub"></param>
        /// <param name="alarmType">报警类型</param>
        /// <returns></returns>
        bool SetAlarmConfigByType(string imei, AlarmTypeBase alarmSub, AlarmType alarmType);
    }
}